//
//  YNavigationController.m
//  shijianpinggu
//
//  Created by apple on 2016/12/23.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "YNavigationController.h"

@interface YNavigationController ()

@end

@implementation YNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //清空弹出手势的代理,可以恢复弹出手势
    self.interactivePopGestureRecognizer.delegate = nil;
    //    改变标题颜色
    NSDictionary *attributes=[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil];
    [self.navigationBar setTitleTextAttributes:attributes];
    
    //    改变背景
    self.navigationBar.translucent = NO;
    
    self.navigationBar.barTintColor = [UIColor clearColor];
//    self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
//    self.extendedLayoutIncludesOpaqueBars
//    = YES;
    //去掉返回按钮上的文字
    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)forBarMetrics:UIBarMetricsDefault];
}


+(void)initialize
{
    
    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
    NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
    textAttrs[NSFontAttributeName] = [UIFont boldSystemFontOfSize:15];
    [[UIBarButtonItem appearance] setTitleTextAttributes:textAttrs forState:UIControlStateNormal];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
